<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/socket/internal/SockData.cpp 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9ad1227260954e346101f3844f0abb3d.html">socket</a></li><li class="navelem"><a class="el" href="dir_1865c4ce8b99f52bbeabfd52bfdd7cd3.html">internal</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">SockData.cpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_sock_data_8cpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_sock_data_8h.html">SockData.h</a>&quot;</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_socket_8h.html">Socket.h</a>&quot;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;../../algorithm/Algorithm.h&quot;</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160; </div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160; </div>
<div class="line"><a name="l00007"></a><span class="lineno"><a class="line" href="_sock_data_8h.html#a22e8fd426629b0689f839d38cd010ee6">    7</a></span>&#160;std::list&lt;SocketData*&gt;::iterator <a class="code" href="_sock_data_8cpp.html#af118a6ae6aa9897c048888d90a5bc53e">GetWaitAccepts</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; svrSock, <a class="code" href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a>* o)</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;{</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;    std::list&lt;SocketData*&gt;::iterator it = svrSock.<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">waitAccepts</a>.end();</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;    <span class="keywordflow">for</span> (it = svrSock.<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">waitAccepts</a>.begin(); it != svrSock.<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">waitAccepts</a>.end(); ++it)</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;    {</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;        <span class="keywordflow">if</span> (o == (*it)-&gt;_pServerBuf-&gt;oved.Get())</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;        {</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;        }</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;    }</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;    <span class="keywordflow">return</span> it;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;}</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="_sock_data_8h.html#a969141759a8f54339a1914f4b04253d8">   21</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="_sock_data_8cpp.html#a969141759a8f54339a1914f4b04253d8">EmptyWaitAccepts</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; svrSock)</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;{</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    <span class="keywordflow">return</span> svrSock.<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">waitAccepts</a>.empty();</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;}</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="_sock_data_8h.html#a815b52d96de953649d002f722249f797">   26</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="_sock_data_8cpp.html#a815b52d96de953649d002f722249f797">IsWaitAcceptsEnd</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; svrSock, <span class="keyword">const</span> std::list&lt;SocketData*&gt;::iterator&amp; it)</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;{</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    <span class="keywordflow">return</span> svrSock.<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">waitAccepts</a>.end() == it;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;}</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="_sock_data_8h.html#a8e93d7214f5f4c092164fb0d3ad223ea">   31</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="_sock_data_8cpp.html#a8e93d7214f5f4c092164fb0d3ad223ea">PushWaitAccepts</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; svrSock, <a class="code" href="struct_socket_data.html">SocketData</a>&amp; cliSock)</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;{</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    svrSock.<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">waitAccepts</a>.push_back(&amp;cliSock);</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;}</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="_sock_data_8h.html#a3ad4f2bcd31cae34aa52ad170ac443db">   36</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="_sock_data_8cpp.html#a3ad4f2bcd31cae34aa52ad170ac443db">EraseWaitAccepts</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; svrSock, <span class="keyword">const</span> std::list&lt;SocketData *&gt;::iterator&amp; it)</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;{</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    svrSock.<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">waitAccepts</a>.erase(it);</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;}</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="_sock_data_8h.html#a5546e898c2794cbdf57a41f1bafbec0f">   41</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="_sock_data_8cpp.html#a3ad4f2bcd31cae34aa52ad170ac443db">EraseWaitAccepts</a>(<a class="code" href="struct_socket_data.html">SocketData</a>&amp; svrSock, <a class="code" href="struct_socket_data.html">SocketData</a>&amp; cliSock)</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;{</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <a class="code" href="_algorithm_8h.html#aa69d6a2300c1f391347658986741d8a8">seq_erase</a>(svrSock.<a class="code" href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">_pServerBuf</a>-&gt;<a class="code" href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">waitAccepts</a>, &amp;cliSock);</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;}</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="a_sock_data_8cpp_html_a3ad4f2bcd31cae34aa52ad170ac443db"><div class="ttname"><a href="_sock_data_8cpp.html#a3ad4f2bcd31cae34aa52ad170ac443db">EraseWaitAccepts</a></div><div class="ttdeci">void EraseWaitAccepts(SocketData &amp;svrSock, const std::list&lt; SocketData * &gt;::iterator &amp;it)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8cpp_source.html#l00036">SockData.cpp:36</a></div></div>
<div class="ttc" id="a_sock_data_8cpp_html_a969141759a8f54339a1914f4b04253d8"><div class="ttname"><a href="_sock_data_8cpp.html#a969141759a8f54339a1914f4b04253d8">EmptyWaitAccepts</a></div><div class="ttdeci">bool EmptyWaitAccepts(SocketData &amp;svrSock)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8cpp_source.html#l00021">SockData.cpp:21</a></div></div>
<div class="ttc" id="a_sock_data_8h_html"><div class="ttname"><a href="_sock_data_8h.html">SockData.h</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="astruct_socket_data_html_aa0eb63e369865fb4ac2fde0bd0b98630"><div class="ttname"><a href="struct_socket_data.html#aa0eb63e369865fb4ac2fde0bd0b98630">SocketData::_pServerBuf</a></div><div class="ttdeci">SharedPtr&lt; SockDataBuffer &gt; _pServerBuf</div><div class="ttdoc">内部使用</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00035">SockData.h:35</a></div></div>
<div class="ttc" id="astruct_o_v_e_r_l_a_p_p_e_d___e_x_html"><div class="ttname"><a href="struct_o_v_e_r_l_a_p_p_e_d___e_x.html">OVERLAPPED_EX</a></div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00063">SockData.h:63</a></div></div>
<div class="ttc" id="a_sock_data_8cpp_html_af118a6ae6aa9897c048888d90a5bc53e"><div class="ttname"><a href="_sock_data_8cpp.html#af118a6ae6aa9897c048888d90a5bc53e">GetWaitAccepts</a></div><div class="ttdeci">DEF_BEG_LIBTOOLS std::list&lt; SocketData * &gt;::iterator GetWaitAccepts(SocketData &amp;svrSock, OVERLAPPED_EX *o)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8cpp_source.html#l00007">SockData.cpp:7</a></div></div>
<div class="ttc" id="astruct_socket_data_html"><div class="ttname"><a href="struct_socket_data.html">SocketData</a></div><div class="ttdoc">套接口数据</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00029">SockData.h:29</a></div></div>
<div class="ttc" id="a_sock_data_8cpp_html_a815b52d96de953649d002f722249f797"><div class="ttname"><a href="_sock_data_8cpp.html#a815b52d96de953649d002f722249f797">IsWaitAcceptsEnd</a></div><div class="ttdeci">bool IsWaitAcceptsEnd(SocketData &amp;svrSock, const std::list&lt; SocketData * &gt;::iterator &amp;it)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8cpp_source.html#l00026">SockData.cpp:26</a></div></div>
<div class="ttc" id="astruct_sock_data_buffer_html_ad55d617e02e179fee61f103f1c7e2034"><div class="ttname"><a href="struct_sock_data_buffer.html#ad55d617e02e179fee61f103f1c7e2034">SockDataBuffer::waitAccepts</a></div><div class="ttdeci">std::list&lt; SocketData * &gt; waitAccepts</div><div class="ttdoc">接收队列(服务端套接字使用)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8h_source.html#l00113">SockData.h:113</a></div></div>
<div class="ttc" id="a_algorithm_8h_html_aa69d6a2300c1f391347658986741d8a8"><div class="ttname"><a href="_algorithm_8h.html#aa69d6a2300c1f391347658986741d8a8">seq_erase</a></div><div class="ttdeci">Cont::iterator seq_erase(Cont &amp;c, const Value &amp;val)</div><div class="ttdoc">从序列容器中删除一个元素</div><div class="ttdef"><b>Definition:</b> <a href="_algorithm_8h_source.html#l00234">Algorithm.h:234</a></div></div>
<div class="ttc" id="a_socket_8h_html"><div class="ttname"><a href="_socket_8h.html">Socket.h</a></div></div>
<div class="ttc" id="a_sock_data_8cpp_html_a8e93d7214f5f4c092164fb0d3ad223ea"><div class="ttname"><a href="_sock_data_8cpp.html#a8e93d7214f5f4c092164fb0d3ad223ea">PushWaitAccepts</a></div><div class="ttdeci">void PushWaitAccepts(SocketData &amp;svrSock, SocketData &amp;cliSock)</div><div class="ttdef"><b>Definition:</b> <a href="_sock_data_8cpp_source.html#l00031">SockData.cpp:31</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
